home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / network / use125.zip / USE.DOC < prev    next >
Text File  |  1992-05-22  |  4KB  |  107 lines

  1.                       Lan Manager Utility USE.EXE
  2.  
  3.  
  4. Dan Shearer, Computer Centre, University of South Australia
  5. Comments and bug reports to:  ccdps@lux.levels.unisa.edu.au
  6.  
  7. Version 1.25 released to the public domain 9th March, 1992.
  8.  
  9.  
  10. Overview
  11. ---------
  12.  
  13. USE saves our LAN a lot of traffic and speeds up operations for our
  14. users (400 or so.)
  15.  
  16. It is a small program designed to be called from LAN batch files for
  17. making and breaking connections to Lan Manager network drives and printers,
  18. instead of the large and slow Microsoft program NET.EXE. It would
  19. probably be just as useful for many other brands of LAN, with one simple
  20. modification. It does only two things:
  21.  
  22.    1.  Lets you use very fast DOS redirect calls to make network connections,
  23.        where possible, and,
  24.  
  25.    2.  Lets you connect a network resource on top of an existing connection,
  26.        without first explicitly deleting it. (ie no more NET USE /DEL commands.)
  27.  
  28. I don't have the Lan Manager Programmer's Toolkit, so I don't know how
  29. to get at the user's password in any fool-proof manner - but it wouldn't
  30. give all that much better performance overall if I did. Suggestions welcome
  31. though, as are bug-reports.
  32.  
  33. Let me know if you want to use this with some other LAN, which uses XYZ.EXE
  34. instead of NET.EXE. I could include a /PATCH option to let you modify the
  35. program name to shell out to.
  36.  
  37.  
  38. Reasoning Behind USE
  39. --------------------
  40.  
  41. All LM functions are accessed through one program, called NET.EXE. This
  42. includes making and breaking network connections, viewing users and
  43. resources, getting the server's time and so on. By far the most common
  44. use for NET is connecting to and disconnecting from network resources.
  45. Why run the huge (165k) NET.EXE for that? Microsoft already provide a
  46. program called USE.EXE, to meet just this question. However! The
  47. Microsoft USE does not use the Lan Manager network programming
  48. interface, so it can't determine the user's password to give a server
  49. when attempting to make a connection. A normal DOS network-redirect call
  50. is sufficient for connecting to a server which has already been
  51. connected to by NET, because Lan Manager only needs to verify the user
  52. once. A first-time connection cannot be made to a Lan Manager server
  53. without including the password.
  54.  
  55. What this means is that you need to know which connections are
  56. first-time connections and which are not, to make intelligent use of the
  57. Microsoft USE. Since our LAN and presumably most others is designed with
  58. as generic a set of batch files as possible, this is clearly and
  59. inefficient thing to do. Hence, we need a program that will figure out
  60. for itself which is the appropriate kind of connection. On our LAN,
  61. first-time connections make up only a tiny fraction of all connections.
  62.  
  63.  
  64. How it Works
  65. ------------
  66.  
  67. My USE.EXE is quite crude. You call it with the same parmeters you would
  68. have given NET.EXE (eg instead of NET USE \\SERVERA\PUBLIC you would go
  69. USE \\SERVERA\PUBLIC) and it tries to do a DOS redirect. If this fails
  70. for any reason at all it searches for NET.EXE in the current directory
  71. and in the path, and attempts to run it with the same parameters. This
  72. means that if there really is a problem you get the detailed error
  73. messages that NET provides. If the DOS calls failed because it is a
  74. first-time connection and there was no password, then NET should just
  75. work as usual. (The overhead of the DOS call is usually very small.)
  76.  
  77. This has the effect of making nearly all network connections blisteringly
  78. fast. Furthermore, since each workstation typically does four or five
  79. USE commands in booting, the saving in network traffic is considerable
  80. even in the first few minutes.
  81.  
  82. The /D parameter is always handled by USE since no password is needed
  83. so deletions are always quick.
  84.  
  85.  
  86. Syntax
  87. ------
  88.  
  89.  
  90. USE [/HELP | /?] | device: \\server\sharename [/Y] | device: /DEL
  91.  
  92.   where:  "device" is a DOS drive or printer port id
  93.           "\\server\sharename" is a resource name
  94.           /Y to delete existing connection before attempting a new one
  95.  
  96.   errorlevels:  99 = problem with NET.EXE, others as for NET
  97.  
  98.  
  99. Examples:
  100.  
  101.    USE G: \\ASERVER\PUBLIC /Y
  102.    USE LPT1: /D
  103.    USE L \\ASERVER\RESTRICTED /Y  (Bad drive, will call NET and give an error.)
  104.    USE F: \\ASERVER\PUBLIC  (no /Y, will call NET and give an error if in use.)
  105.    USE  (no paramters, so will call NET USE with no params, ie list connections)
  106.  
  107.